package com.spudtech.tween
{
    
    import flash.geom.*;
    import flash.display.*;
    
    import com.spudtech.*;
    
    
    public class SpudNumberTween extends SpudTween
    {
        
        protected var _startVal : Number;
        protected var _endVal : Number;
        
        
        public function SpudNumberTween(start : Number,
                                    end : Number,
                                    step_count : uint,
                                    play_mode : uint = PLAY_ONCE,
                                    init_easer : Function = null,
                                    init_callback : Function = null)
        {
            super(step_count, play_mode, init_easer, init_callback);
            
            _startVal = 0;
            _endVal = 0;
            
        }
        
        public function get startVal() : Number
        {
            return _startVal;
        }
        public function set startVal(new_start : Number) : void
        {
            if (_startVal == new_start)
            {
                // This is the same start value
                return;
            }
            
            _startVal = new_start;
            
        }
        
        public function get endVal() : Number
        {
            return _endVal;
        }
        public function set endVal(new_end : Number) : void
        {
            if (_endVal == new_end)
            {
                // This is the same end value
                return;
            }
            
            _endVal = new_end;
            
        }
        
        public function get currentVal() : Number
        {
            return SpudRoot.lerp(startVal,endVal,step,stepCount);
        }
        
        
        override public function update() : void
        {
            super.update();
        }
        
    }
    
}
